/*
 * @Descripttion: 
 * @Author: zhanyi
 * @Date: 2021-10-19 20:00:47
 * @FilePath: \wczd-mobile\src\main.js
 */
import App from './App'
import store from './store'
import permission from './directive/permission'
import '@/common/env.js'

// #ifndef VUE3
import Vue from 'vue'
import { getDicts } from '@/api/utils'
import { getDate,selectDictLabel,wh_formatFloat } from '@/common/util'
Vue.prototype.getDate = getDate
Vue.prototype.getDicts = getDicts
Vue.prototype.wh_formatFloat = wh_formatFloat
Vue.prototype.selectDictLabel = selectDictLabel
Vue.config.productionTip = false
Vue.prototype.$store = store
Vue.prototype.$adpid = "1111111111"
Vue.prototype.$backgroundAudioData = {
	playing: false,
	playTime: 0,
	formatedPlayTime: '00:00:00'
}

App.mpType = 'app'
Vue.use(permission)
store.dispatch('GetInfo').then(res => {
	const app = new Vue({
		store,
		...App
	})
	app.$mount()
}).catch(()=>{
	const app = new Vue({
		store,
		...App
	})
	app.$mount()
})
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp () {
	const app = createSSRApp(App)
	app.use(store)
	app.config.globalProperties.$adpid = "1111111111"
	app.config.globalProperties.$backgroundAudioData = {
		playing: false,
		playTime: 0,
		formatedPlayTime: '00:00:00'
	}
	return {
		app
	}
}
// #endif
